package com.tz.web.adminstat;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.tz.bean.TzParams;
import com.tz.service.course.IStatService;

/**
 * 日记管理web
 * StatController<BR>
 * 作者:Marlon  <BR>
 * 时间:2016年4月6日 下午1:01:55  <BR>
 * 电话:18093454447  <BR>
 * 邮箱:18093454447@163.com  <BR>
 * @version 1.0.0  <BR>
 * @link see:  <BR>
 *
 */
@Controller
@RequestMapping("/admin/echart")
public class StatController {
	
	@Autowired
	private IStatService statService;
	
	/*列表查询*/
	@ResponseBody
	@RequestMapping(value="/courselist",method=RequestMethod.POST)
	public List<HashMap<String, Object>> list(TzParams params){
		List<HashMap<String, Object>> datas = statService.groupCourse(params);
		return datas;
	}
	
	/*根据月份列表查询*/
	@ResponseBody
	@RequestMapping(value="/monthlist",method=RequestMethod.POST)
	public List<HashMap<String, Object>> monthlist(TzParams params){
		List<HashMap<String, Object>> datas = statService.groupByMonth(params);
		return datas;
	}
	
	@RequestMapping("/list")
	public String list(){
		return "echart/list";
	}
}
